package com.guldan.jaina.utils;

import com.guldan.jaina.dto.gauthority.GAuthorityDTO;
import com.guldan.jaina.dto.users.UserCacheDTO;
import com.guldan.jaina.dto.users.UsersDTO;

import java.util.List;

/**
 * Created by Silas.
 * Date: 2016/12/8
 * Time: 1:36
 */
public class UserUtils {

    private static ThreadLocal<UsersDTO> threadLocal = new ThreadLocal<>();

    public static void setUser(UsersDTO dto) {
        threadLocal.set(dto);
    }

    //获取用户登录信息
    public static UsersDTO getUser() {
        return threadLocal.get();
    }

    //判断是否是录入人员角色
    public static boolean isTowns() {
        return "typein".equals(threadLocal.get().getUserType());
    }

}
